<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>泉城投票</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/css/vote/unregister/frozen.css">
    <link rel="stylesheet" href="/css/vote/unregister/vote.css">
    <script src="/js/admin/jquery.min.js" type="text/javascript"></script>
    <script src="/js/dependencies/layer/layer.js"></script>
</head>
<body>
<div class="vote-text">
    @yield('test')
    <div id="main" style="background-image:url('{{$backgroundImg or '/images/vote/unregister/wen.png'}}');">
        <div class="ui-whitespace header">
            <h1 class="center" id="vote-title"></h1>
            @yield('titleRules')
        </div>
        @section('listContent')
            <div class="ui-whitespace">
                <ul class="ui-row-flex voteTab mt25">
                    <li class="ui-col ui-flex ui-flex-pack-center @yield('votecure')" data-type="vote">
                        <div>投票</div>
                    </li>
                    <li class="ui-col ui-flex ui-flex-pack-center @yield('searchcure')" data-type="search">
                        <div>检索</div>
                    </li>
                    <li class="ui-col ui-flex ui-flex-pack-center @yield('sortcure')" data-type="sortlist">
                        <div>排行</div>
                    </li>
                </ul>
                <!-- 投票  S-->
                <div class="tabList">
                    @section('contents')
                    @show
                </div><!-- 投票  E-->
            </div>
        @show
    </div>
</div>
<script>
	window.__vote_id = "{{ $voteId }}";
	window.__uid = "{{ $uid }}";
	window.__signed = "{{ $signed }}";
	window.__query_string = "{!! $queryString !!}";
</script>
@section('get-vote-details')
<script>
    $.ajax({
        url: '/lua/api/vote/details',
        data: {vote_id: __vote_id},
        type: 'get',
        dataType: 'json',
        success: function (response) {
            if (response.code == 200) {
                var vote = response.data.details;
                document.title = vote.title;
                $('#vote-title').text(vote.title);
                $('#vote-rules').html(vote.rules);
                $('#vote-duration').text(vote.duration);
//                if(vote.background_img){
//                    $('#main').css("background-image","url('"+vote.background_img+"')");
//                }
            }
        },
        error: function (error) {
            console.log(error);
        }
    });
</script>
@show
@yield('script')
</body>
</html>